-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Radix primitive based Drawer component #2445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality seems to work, need to improve the default styling - ideally we shouldn't have to set margin/padding props in the usage level
The dictionary of the component style as value and the style notation as key. | ||
""" | ||
base_style = { | ||
"left": "0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be setting all of these? Then it will stretch to the full width of the page I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A variation of that if not that precisely. Basically trying to replicate the shadcn UI implementation, their drawer is basically this drawer component plus this. From the look of it, their drawer is always coming up from bottom. Without these style below, the drawer will be just a dialogue flying in from a certain direction (not sure if that should still be called drawer).
<DrawerPrimitive.Content
ref={ref}
className={cn(
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
className
)}
{...props}
>
base_style.update(style) | ||
self.style.update( | ||
{ | ||
"css": base_style, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have to put it in the css tag? I think we automatically handle this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must've been misinformed. Can you point me to an example how the latest way to do this?
61bbd7b
to
ce2f9d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works well for me
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.